package pl.grabar.clinic.core.domain.person.data;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Pattern;

/**
 * Klasa reprezentująca adres
 * 
 * @author db
 * 
 */
@Entity
@Table(name = "ADRESS")
public class Address implements Serializable {

	private static final long serialVersionUID = -7627044823927080407L;

	@Id
	@GeneratedValue
	private long id;

	/**
	 * Wojewodztwo
	 */
	@Column
	private String province;

	/**
	 * Miasto
	 */
	@Column
	private String city;

	/**
	 * Ulica
	 */
	@Column
	private String street;

	/**
	 * Kod pocztowy
	 */
	@Column(name = "POST_CODE")
	@Pattern(regexp = "[0-9]{2}( |-)?[0-9]{3}", message = "Niepoprawny kod pocztowy")
	private String postCode;

	/**
	 * Nr budynku, ulicy
	 */
	@Column(name = "STREET_NO")
	private int streetNo;

	/**
	 * Nr lokalu
	 */
	@Column(name = "PLACE_NO")
	private int placeNo;

	public Address() {
	}

	/* AKCESORY */

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public String getPostCode() {
		return postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public int getStreetNo() {
		return streetNo;
	}

	public void setStreetNo(int streetNo) {
		this.streetNo = streetNo;
	}

	public int getPlaceNo() {
		return placeNo;
	}

	public void setPlaceNo(int placeNo) {
		this.placeNo = placeNo;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}
}
